package com.whmskj.xjlhsc.mobie.ProductionManagement.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.whmskj.xjlhsc.controller.vo.Result;
import com.whmskj.xjlhsc.mobie.ProductionManagement.pojo.dto.GetYieldReportsDTO;
import com.whmskj.xjlhsc.mobie.ProductionManagement.pojo.vo.MonthYieldReportsVO;
import com.whmskj.xjlhsc.mobie.ProductionManagement.pojo.vo.YieldReportsResultVO;
import com.whmskj.xjlhsc.mobie.ProductionManagement.pojo.vo.YieldVO;
import com.whmskj.xjlhsc.mobie.ProductionManagement.service.imp.YieldReportsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.time.YearMonth;
import java.util.List;

/**
 * @author jiaruchun
 * @date 2025-08-29 10:25
 */
@SaIgnore
@Api(tags = "产量报表接口")
@RestController
@RequestMapping("/mobile/ProductionManagement/YieldReports")
public class YieldReportsController {

    @Autowired
    private YieldReportsServiceImpl yieldReportsService;


    @PostMapping
    public Result getYieldReports(@RequestBody GetYieldReportsDTO getYieldReportsDTO) {
        YieldVO yieldReport = yieldReportsService.getYieldReports(getYieldReportsDTO);
        return Result.success(yieldReport);
    }

    //月报盘存时间段统计
    @GetMapping
    public Result getYieldReportsByMonth() {
        return Result.success(yieldReportsService.getMonthYieldReports());
    }

}
